package com.bhs.sansonglogistics.ui.adapter;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bhs.sansonglogistics.R;
import com.bhs.sansonglogistics.bean.CircleFriendsBean;
import com.bhs.sansonglogistics.bean.JudgeListDTO;
import com.bhs.sansonglogistics.ui.message.CirclePersonageActivity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class CommentAdapter extends BaseQuickAdapter<JudgeListDTO, BaseViewHolder> {

    public CommentAdapter( @Nullable List<JudgeListDTO> data) {
        super(R.layout.item_comment, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, JudgeListDTO item) {
        TextView textView =helper.getView(R.id.tv_nick_name);
        helper.setText(R.id.tv_nick_name,item.getName());
        helper.setText(R.id.tv_comment,item.getWords());
        helper.addOnClickListener(R.id.tv_comment);
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mContext.startActivity(new Intent(mContext, CirclePersonageActivity.class)
                        .putExtra("uid", item.getUnid())
                        .putExtra("logistics_id", item.getLogistics_id()));
            }
        });
    }
}
